package com.hzgj.bcl.soa.cicada.handle;

import com.hzgj.bcl.soa.cicada.sender.CicadaSender;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.netty.channel.Channel;
import lombok.Getter;

public abstract class Processor {

    protected final Logger logger = LoggerFactory.getLogger(getClass());
    @Getter
    protected final CicadaSender cicadaSender;

    public Processor(CicadaSender cicadaSender) {
        this.cicadaSender = cicadaSender;
    }

    public abstract void handle(Channel channel, ResponseFuture<Object> future, Object message) throws Exception;

    public abstract void onError(ResponseFuture<Object> future, Throwable error);

    public abstract void onClose(ResponseFuture<Object> future);

}
